package com.yzjs.controller.dataInfo;

import com.yzjs.common.enumeration.RequestMethod;
import com.yzjs.entity.vo.DataInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yzjs.entity.dataInfo.DataInfoEntity;
import com.yzjs.service.dataInfo.DataInfoService;

import java.util.Map;


/**
 * 上链数据表
 *
 * @author dingjiahui
 * @email sunlightcs@gmail.com
 * @date 2021-10-19 13:44:28
 */
@Api(tags = "上链数据表")
@RestController
@RequestMapping("dataInfo")
public class DataInfoController {
    @Autowired
    private DataInfoService dataInfoService;

    @SneakyThrows
    @ApiOperation(value = "上链",httpMethod = RequestMethod.POST)
    @RequestMapping("/dataUpload")
    public DataInfoEntity DataInfoUpload(@RequestBody DataInfoVO vo){
        return dataInfoService.dataUpload(vo);
    }

    @SneakyThrows
    @ApiOperation(value = "删除",httpMethod = RequestMethod.POST)
    @RequestMapping("/dataDelete")
    public DataInfoEntity DataInfoDelete(@RequestBody DataInfoVO vo){
        return dataInfoService.dataDelete(vo);
    }

    @SneakyThrows
    @ApiOperation(value = "查询",httpMethod = RequestMethod.POST)
    @RequestMapping("/dataSelect")
    public DataInfoEntity DataInfoSelect(@RequestBody Map<String,Object> params){
        return dataInfoService.dataSelect(params);
    }
}
